//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Collections;
using CommunityServer.Components;
using CommunityServer.Galleries.Components;

namespace CommunityServer.Galleries
{
	/// <summary>
	/// Summary description for GalleryPostCategories.
	/// </summary>
	public class GalleryPostCategories 
	{

		#region Get By CategoryID
//		/// <summary>
//		/// Gets the specified category by CategoryID. CategoryType is required for the 
//		/// cache look up. Will only return "allowed/published" categories.
//		/// </summary>
//		public static GalleryPostCategory GetCategory(int categoryID, int forumID)
//		{
//			return GetCategory(categoryID, forumID, false);
//		}
//
//		/// <summary>
//		/// Gets the specified category by CategoryID. CategoryType is required for the 
//		/// cache look up. Will filter "allowed/published" categories.
//		/// </summary>
//		public static GalleryPostCategory GetCategory(int categoryID, int forumID, bool allowDisabled)
//		{
//			return (GalleryPostCategory)PostCategories.GetCategory(categoryID, forumID, allowDisabled);
//		}
//		#endregion
//
//		#region Get By CategoryName
//		/// <summary>
//		/// Gets the specified category by CategoryID. CategoryType is required for the 
//		/// cache look up. Will only return "allowed/published" categories.
//		/// </summary>
//		public static GalleryPostCategory GetCategory(string name, int forumID)
//		{
//			return GetCategory(name, forumID, false);
//		}
//
//		/// <summary>
//		/// Gets the specified category by CategoryID. CategoryType is required for the 
//		/// cache look up. Will filter "allowed/published" categories.
//		/// </summary>
//		public static GalleryPostCategory GetCategory(string name, int forumID, bool allowDisabled)
//		{
//			return (GalleryPostCategory)PostCategories.GetCategory(name, forumID, allowDisabled);
//		}
		#endregion

		#region Get All

		/// <summary>
		/// Returns all of the categories (cache optional). Can be filtered by allowed categories and parentID
		/// </summary>
		public static ArrayList GetCategories(int forumID, bool cacheable, bool allowDisabled, int parentID, bool flush)
		{
			ArrayList categories = new ArrayList();
			//Just cast the items to the GalleryPostCategory Type
			foreach(PostCategory category in PostCategories.GetCategories(forumID, cacheable, allowDisabled, parentID, flush))
					categories.Add( GalleryPostCategory.Parse(category)  );

			return categories;
		}
		#endregion

	}
}
